package cn.wangqi.personal.util;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

/**
 * Created by admin on 2017/9/6.
 */
public abstract class Result<T extends Serializable> {
    public static final String RETURN_CODE = "c";
    public static final String RETURN_MSG = "m";
    public static final String RETURN_DATA = "d";
    public static final String RESULT_SUCCESS = "100";
    public static final String RESULT_ERROR = "200";
    public static final String RESULT_WARN = "300";
    public static final String RESULT_AUTH_INVALID = "400";
    public static final String RESULT_NO_REAL_NAME = "401";
    public static final String RESULT_NOPERMISSION = "500";
    public static final String RESULT_NOPERMISSION_LIMIT = "501";
    private String code = "100";
    private String msg;

    public Result() {
    }

    @JsonProperty("c")
    public String getCode() {
        return this.code;
    }

    public Result<T> setCode(String code) {
        this.code = code;
        return this;
    }

    @JsonProperty("m")
    public String getMsg() {
        return this.msg;
    }

    public Result<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }
}